﻿<%@ Page Title="" Language="C#" MasterPageFile="~/Views/Shared/Site.Master" Inherits="System.Web.Mvc.ViewPage<DR.WebUI.Models.Developer.EditReport>" %>
<%@ Import Namespace="System.Globalization"%>

<asp:Content ID="Content1" ContentPlaceHolderID="TitleContent" runat="server">
	Developer Report Edit
</asp:Content>

<asp:Content ID="Content2" ContentPlaceHolderID="MainContent" runat="server">

    <h3>Developer Report Edit</h3>

    <%Html.EnableClientValidation(); %>
    <% using (Html.BeginForm("EditReport", "Developer"))
    {%>
    <%: Html.Hidden("ReportID", Model.ReportID) %>
    <%: Html.Hidden("DateCreate", Model.DateCreate) %>
    <%: Html.Hidden("DateModified", DateTime.Now)%>
    <table>
        <tr>
            <td style="width:120px;" class="tableBold">
                <%:Html.Label("Report ID:")%>
            </td>
            <td>
                <%:Html.Label(Model.ReportID.ToString())%>
            </td>
        </tr>
        <tr>
            <td class="tableBold">
                <%:Html.Label("Report created:")%>
            </td>
            <td>
                <%:Html.Label(Model.DateCreate.ToString("d", DateTimeFormatInfo.InvariantInfo))%>
            </td>
        </tr>
        <tr>
            <td class="tableBold">
                <%:Html.Label("Report modified:")%>
            </td>
            <td>
                <% if (Model.DateModified != null)
                   {%>
                    <%:Html.Label(Model.DateModified.Value.ToString("d", DateTimeFormatInfo.InvariantInfo))%>
                <% }
                   else
                   { %>
                       <%:Html.Label("Was not modified")%>
                <% } %>
            </td>
        </tr>
        <tr>
            <td class="tableBold">
                <%:Html.Label("Report Period:")%>
            </td>
            <td>
                <%:Html.DropDownList("ReportingPeriodID", (IList<SelectListItem>)ViewData["EditReportPeriodList"], new { @class = "reportingPeriod" })%>
                <br />
                <div class="field-validation-error" id="reportPeriodIDError"/>
                <%:Html.ValidationMessageFor(model => model.ReportingPeriodID)%>
            </td>
        </tr>
        <tr>
            <td class="tableBold">
                <%:Html.Label("Project:")%>
            </td>
            <td>
                <%:Html.DropDownList("ProjectID", (IList<SelectListItem>)ViewData["DeveloperProjects"], "", new { @class = "modalTextBox" })%>
                <br />
                <div class="field-validation-error" id="errors"/>
                <%:Html.ValidationMessageFor(model => model.ProjectID)%>
            </td>
        </tr>
        <tr>
            <td class="tableBold">
                <%:Html.Label("Title:")%>
            </td>
             <td>
                <%:Html.TextBox("Title", Model.Title, new {@class = "modalTextBox"})%>
                <br />
                <%:Html.ValidationMessageFor(model => model.Title)%>
            </td>
        </tr>
        <tr>
            <td class="tableBold">
                <%:Html.Label("Hours:")%>
            </td>
            <td>
                <%:Html.TextBox("Hours", Model.Hours, new { @class = "miniTextBox" })%>
                <br />
                <%:Html.ValidationMessageFor(model => model.Hours)%>
            </td>
        </tr>
        <tr>
            <td class="tableBold">
                <%:Html.Label("Date of report:")%>
            </td>
            <td>
                <input type="text" id="DateReporting" name="DateReporting" value="<%=Model.DateReporting.ToShortDateString() %>" class="miniTextBox" />
                <br />
                <%:Html.ValidationMessageFor(model => model.DateReporting)%>
            </td>
        </tr>
        <tr>          
             <td colspan="2">
                <b>
                <%:Html.Label("Description:")%>
                </b>
                <br />
                <%:Html.TextArea("Description", Model.Description, new { @class = "editDescriptionTextArea" })%>
                <br />
                <%:Html.ValidationMessageFor(model => model.Description)%>
            </td>
        </tr>      
        <tr>
            <td>
            </td>
            <td style="text-align:right;">
                <input type="submit" value="Save" id="edit" style="width:100px;"/>
                <input type="button" value="Cancel" id="cancel" style="width:100px;" onclick="window.location.href='/Developer/MyReports'"/>
            </td>
        </tr>
    </table>
    <%}%>
</asp:Content>

<asp:Content ID="Content3" ContentPlaceHolderID="headPlaceHolder" runat="server">
    <script type="text/javascript" src="<%= Url.Content("~/Scripts/MicrosoftAjax.js")%>"></script>
    <script type="text/javascript" src="<%= Url.Content("~/Scripts/MicrosoftMvcValidation.js")%>"></script>
    <script type="text/javascript" src="<%= Url.Content("~/Scripts/jquery-1.4.4.min.js")%>"></script>
    <script type="text/javascript" src="<%= Url.Content("~/Scripts/jquery-ui-1.8.7.custom.min.js")%>"></script>
    <script type="text/javascript" src="<%= Url.Content("~/Scripts/Developer/add-new-report.js")%>"></script>
    <link type="text/css" href="<%= Url.Content("~/Content/jquery/jquery-ui-1.8.7.custom.css")%>" rel="stylesheet" />

    <script type="text/javascript" language="javascript">
        $(function () {
            $("#DateReporting").datepicker();
            $("#edit").button();
            $("#cancel").button();
        });
	</script>

</asp:Content>
